package com.xiepxcc.annotation.base.service;


import com.xiepxcc.annotation.base.anno.LogAnnotation;
import com.xiepxcc.annotation.base.anno.NoticeAnnotation;
import com.xiepxcc.annotation.base.anno.RegisteredAnnotation;
import com.xiepxcc.annotation.base.vo.LoginVO;
import org.springframework.stereotype.Service;

@Service
@RegisteredAnnotation(name = "AccessService")
public class AccessService {
    //与其它注解一样的使用
    @LogAnnotation(desc="this is AccessService")
    public void access() {
        System.out.println("access ...");
    }

    @NoticeAnnotation("this is AccessService,Notice one")
    @NoticeAnnotation("this is AccessService,Notice two")
    public void notice() throws Exception{
        System.out.println("notice ...");
        throw new Exception("notice exception");
    }

    @RegisteredAnnotation(name = "query")
    public void query(String id){
        System.out.println("query ...id:"+id);
    }

    @RegisteredAnnotation(name = "delete")
    public void delete(){
        System.out.println("delete ...");
    }

    public void toDo(LoginVO userVO){
        test(userVO);
    }

    private void test(LoginVO userVO){
        System.out.println("test:"+userVO.getId()+""+userVO.getPass());
    }
}
